When using upload_scan in response result 'id' is not present in self.data#51
When using upload_scan in response result 'id' is not present in self.data#51dmlae wants to merge 1 commit intoDefectDojo:masterfrom
Conversation
… presend in self.data.
Changed to check if 'id' exists, else it will return Engagement ID.
Traceback (most recent call last):
File "d.py", line 280, in <module>
create_findings(dd, engagement_id, args.scanner, args.scan_file_name)
File "d.py", line 248, in create_findings
test_id = upload_scan.id()
File "python/dojotools/v-dd/lib/python3.9/site-packages/defectdojo_api/defectdojo_apiv2.py", line 1339, in id
return int(self.data["id"])
KeyError: 'id'
|
Which call are you executing against the api? I don't think this change should be necessary. The POST on the engagements endpoint returns an |
|
I'm calling |
|
Based on the dojo_ci.py code present in the repo: |
|
upload_scan in the api wrapper calls import_scan on the server. I think import_scan on the server should return an id, same a reimport probably. Can you create a github issue in the main repo? |
|
Yeah no problem, I'm just finishing some stuff and will create it. Thank you |
|
I have the same issue @valentijnscholten , is this going to be merged? |
|
The id() method is used for responses that contain a model. The import and reimport don't contain a model. There is a field |
|



When creating a new Engagement and uploading Scan results 'id' is not present in self.data.
Changed to check if 'id' exists, else it will return Engagement ID.
Error:
Traceback (most recent call last):
File "d.py", line 280, in
create_findings(dd, engagement_id, args.scanner, args.scan_file_name)
File "d.py", line 248, in create_findings
test_id = upload_scan.id()
File "python/dojotools/v-dd/lib/python3.9/site-packages/defectdojo_api/defectdojo_apiv2.py", line 1339, in id
return int(self.data["id"])
KeyError: 'id'